package com.rzico.order.enumx;

/**
 * Created by icssh on 2020/4/11.
 */
public enum AskforStatusEnum {

    /**
     * 退货状态(0:未确认,1:已确认,2:已发货,3.已核销,4.已完成,5.已关闭)
     */
    ASKFOR_STATUS_UNCONFIRM(0, "未确认"),
    ASKFOR_STATUS_CONFIRM(1, "已确认"),
    ASKFOR_STATUS_SHIPPING(2, "已寄回"),
    ASKFOR_STATUS_SHIPPED(3, "待退款"),
    ASKFOR_STATUS_COMPLETE(4, "已完成"),
    ASKFOR_STATUS_CANCLEED(5, "已关闭"),
    ASKFOR_STATUS_REFUSED(6, "已拒绝");

    private Integer id;
    private String name;

    AskforStatusEnum(Integer id, String name) {
        this.id = id;
        this.name = name;
    }

    public Integer getId() {
        return this.id;
    }

    public String getName() {
        return this.name;
    }

    public static String getNameById(Integer id){
        if (id == null) {
            return null;
        }
        AskforStatusEnum anEnum = getById(id);
        if (anEnum == null) {
            return null;
        }
        return anEnum.getName();
    }

    public static AskforStatusEnum getById(Integer id) {
        for (AskforStatusEnum anEnum : values()) {
            if (anEnum.getId().equals(id)) {
                return anEnum;
            }
        }
        return null;
    }

}
